<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0px;
				padding: 0px;
			}

			li {
				list-style-type: none;
			}

			a {
				text-decoration: none;
				font-size: 14px;
			}

			/*	#whole { 
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translate(-50%, -50%);
			} */

			#whole {
				width: 500px;
				height: 500px;
				margin: 100px auto;
			}

			.nav>li {
				float: left;
			}

			.nav>li>a {
				display: block;
				color: orange;
				width: 70px;
				height: 40px;
				text-align: center;
				line-height: 40px;
			}

			.nav>li>a:hover {
				background-color: lightgray;
			}

			.nav>li>ul>li {
				display: block;
				color: orange;
				width: 70px;
				height: 40px;
				text-align: center;
				line-height: 40px;
				border: 1px solid orange;
			}

			.nav>li>ul {
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="whole">
			<ul class="nav">
				<li>
					<a href="#">微博</a>
					<ul>
						<li>
							<a href="">私信</a>
						</li>
						<li>
							<a href="">评论</a>
						</li>
						<li>
							<a href="">@我</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">微博</a>
					<ul>
						<li>
							<a href="">私信</a>
						</li>
						<li>
							<a href="">评论</a>
						</li>
						<li>
							<a href="">@我</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">微博</a>
					<ul>
						<li>
							<a href="">私信</a>
						</li>
						<li>
							<a href="">评论</a>
						</li>
						<li>
							<a href="">@我</a>
						</li>
					</ul>
				</li>
				<li>
					<a href="#">微博</a>
					<ul>
						<li>
							<a href="">私信</a>
						</li>
						<li>
							<a href="">评论</a>
						</li>
						<li>
							<a href="">@我</a>
						</li>
					</ul>
				</li>

			</ul>

		</div>
		<script type="text/javascript">
			var nav = document.querySelector(".nav");
			var list = nav.children;
			for (var i = 0; i < list.length; i++) {
				list[i].onmouseover = function() {
					this.children[1].style.display = "block";
					// console.log("xxx");
					// console.log(this.children[1]);
				}
				list[i].onmouseout = function() {
					this.children[1].style.display = "none";
				}
			}
		</script>
	</body>
</html>
